import 'package:flutter/material.dart';
import '../constants/colors.dart';

/// 页面指示器组件
///
/// 用于显示当前页面位置（圆点指示器）
class PageIndicator extends StatelessWidget {
  /// 当前页面索引
  final int currentPage;

  /// 总页面数
  final int pageCount;

  const PageIndicator({
    super.key,
    required this.currentPage,
    required this.pageCount,
  });

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: List.generate(
        pageCount,
        (index) => Container(
          margin: const EdgeInsets.symmetric(horizontal: 4),
          width: currentPage == index ? 12 : 8,
          height: 8,
          decoration: BoxDecoration(
            color: currentPage == index
                ? const Color(0xFFFF4E28)
                : const Color(0xFFFF4E28).withOpacity(0.3),
            borderRadius: BorderRadius.circular(4),
          ),
        ),
      ),
    );
  }
}
